﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Collections;
public partial class Stat_CmsTypeStat : System.Web.UI.Page
{
    Usas.BLL.Cms.StatOperate so = new Usas.BLL.Cms.StatOperate();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ClientBind();
        }
    }


    private void ClientBind()
    {
        ArrayList XTitle = new ArrayList();

        ArrayList[] ChartData = new ArrayList[1];
        ChartData[0] = new ArrayList();

     

        DataSet ds1 = so.CmsTypeStat();

        if (ds1 != null && ds1.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
            {
                XTitle.Add(ds1.Tables[0].Rows[i]["TypeName"].ToString());
                //object b = ds1.Tables[0].Rows[i][""] == null || ds1.Tables[0].Rows[0][i].ToString() == "0" || ds.Tables[0].Rows[0][i].ToString() == "" ? "0" : ds.Tables[0].Rows[0][i].ToString();
                ChartData[0].Add(ds1.Tables[0].Rows[i]["sc"].ToString());
            }
        }
        StatChartlet1.ChartTitle.Text = "文章类型统计";
        StatChartlet1.YLabels.UnitText = "数量";
        StatChartlet1.XLabels.UnitText = "类型";

        StatChartlet1.InitializeData(ChartData, XTitle, null);
    }
}
